Working in Python Module Manager

CSense installs its own instance of Python. You can use the Python Module Manager application to install additional Python modules that are not part of the Python installation shipped with CSense.

The CSense instance of Python can coexist with other Python instances on your machine. In such a case, always use the CSense Python Module Manager application to install Python modules for the CSense-managed instance of Python.

You can perform the following actions using the Python Module Manager application:

Requirements

The following are the requirements to use the Python Module Manager application:

  • Internet access to download all the required modules and their dependencies

  • It is recommended to download required Python modules from pypi.org

  • Administrative privileges to run the Python Module Manager application

  • Some modules may have dependencies on other modules. For example, setuptools must be installed before the installation of control module. In such cases, you can download the required modules from pypi.org

  • Ensure that you download the correct Python version and supported target platform of the relevant modules. Carefully note the supported Python version displayed in the Python Module Manager.

Supported file formats

The following file formats are supported for the downloaded Python modules:

  • Wheel (*.whl)

  • Source (*.gz)

Open Python Module Manager

Using the CSense Start Center

  1. Open CSense Start Center.

  2. On the Home tab, below the Tools section, click Python Module Manager.
    The Python Module Manager application opens.

Using the CSense Architect Application

  1. Open Architect from the CSense Start Center.
    The Architect application opens.

  2. From the Rules & Models group, drag-and-drop the  Python Scripting  block onto the blueprint canvas.

  3. On the  blueprint  canvas, either double-click the added Python Scripting block or right-click the Python Scripting block and then select Block Properties .
    The Python Scripting properties window opens.

  4. Click the Modules  button.
    If prompted  to allow changes, click Yes .
    The Python Module Manager  application  opens.

Using the Command line

  1. Navigate to the folder where you have installed CSense.
    The default CSense installation location is C:\Program Files (x86)\Proficy\Proficy CSense . If you had selected a different installation location, navigate to that location.

  2. In the installation folder, run PythonModuleManager.exe.
    The Python Module Manager application opens.

Add Modules

You can add (install) the Python modules that you have downloaded from pypi.org.  

To install the Python modules, perform the following steps :

  1. Open the Python Module Manager application.

  2. On the Python Module Manager window, click the Add button and browse to the new module.  
    You can view the installation progress status on the python modules installation/uninstallation status display. Once your module and its dependencies are successfully installed, it will be listed in the Python Module Manager window.

Remove Modules

You can remove Python modules using Python Module Manager.

To remove the Python modules, perform the following steps:

  1. Open the Python Module Manager application.

  2. On the Python Module Manager window, below the  Installed Python Modules column, select the required modules to be removed.

    Note: To select multiple modules, press and hold the ctrl key and continue to select the modules.

  3. Click the Remove button.

    -Or-

    You can also right-click the selected modules and select Remove Modules.
    The selected modules are removed.

Back up installed Python Modules

You can back up the installed Python modules in the following scenarios:

  • Migrate CSense from one machine to another.

  • Quickly restore the previously installed modules on any machine where CSense is installed.

NOTE: When you add modules using the Python Module Manager application, the Installation files used to add the modules and the order in which they were added are archived internally.

To back up the installed Python modules, perform the following steps:

  1. Open the Python Module Manager application.

  2. On the Python Module Manager window, click the Backup button.

  3. Browse to the folder where you need to archive, and provide a filename.

    The Installation files that were saved while adding the modules are exported as the Python Manager Backup (*.pybackup) file.

    Note that the dependent modules installed will not be backed up. However, it will be installed automatically from the internet while you restore from a previously saved Python Module Manager Backup (*.pybackup) file.

Restore a previous backup file

Using the Python Module Manager Application

You can restore the files archived during backup process using the Python Module Manager application.

To restore the Python Manager Backup (*.pybackup) file , perform the following steps:

  1. Open the Python Module Manager application.

  2. On the Python Module Manager window, click the Restore button.

  3. Browse to the folder where your .pybackup file is located.

  4. Select the .pybackup file and then click the Open button.
    The modules present in the Python Manager Backup (*.pybackup) file will be installed in the same order as the modules were added initially. Monitor the information status window for detailed feedback.

  5. Once all the modules have been restored, you can safely close this window.

While restoring a backup, the following icons indicate the installation status.

Icon

Description

Success

Indicates that the module was successfully installed.

Warning

Indicates that the module version was upgraded or downgraded to the version contained in the backup file.

Fail

Indicates that the module failed to install. View information status window for more information.

Using Command prompt

You can also restore the Python Manager Backup (*.pybackup) file using the following steps in a Command Prompt:

  1. As an administrator, open a command prompt and navigate to C:\Program Files (x86)\Proficy\Proficy CSense.
    The default Csense installation location is C:\Program Files (x86)\Proficy\Proficy CSense. If you had selected a different installation location, navigate to that location.

  2. Run the following Command:PythonModuleManager.exe "<backup file name with full folder path>".
    For example, PythonModuleManager.exe "C:\PythonModulesArchived.pybackup"
    The modules are restored. If any failures occur during the restore, please note the Status/Error code, and refer to Status/Error codes.

    Note: The modules present in the Python Manager Backup (*.pybackup) file will be installed in the same order as the modules were added initially.

Status/ Error Codes

When you restore  the Python Manager Backup (*.pybackup) file using Command Prompt, the following Status/Error codes indicate the status.

Status/ Error Code

Description

0

All modules in the Python Manager Backup (*.pybackup) file were restored successfully.

1

Some modules in the Python Manager Backup (*.pybackup) file were not installed successfully.

2

The Python Manager Backup (*.pybackup) file provided as argument does not exist.

3

Too many arguments or not a valid Python Manager Backup (*.pybackup) file.

 


Related topics:

  

CSense 2023- Last updated: June 24,2025